# Sets the minimum version of CMake required to build the native library.
cmake_minimum_required(VERSION 3.4.1)
#拼接ffmpeg目录
set(PREFIX "${CMAKE_SOURCE_DIR}/jniLibs/ffmpeg-5.1.6/29/armeabi-v7a")
#包含ffmpeg头文件目录
include_directories(${PREFIX}/include)
#添加链接目录
link_directories(${PREFIX})
# 搜索ffmpeg目录下的所有.so文件ni
file(GLOB SO_FILES  "${PREFIX}/*.so" )
# 获取目录下所有库名
foreach(SO_FILE IN LISTS SO_FILES)
    # 获取不带路径的文件名
    get_filename_component(LIB_NAME ${SO_FILE} NAME)
    list(APPEND FFMPEG_LIBRARIES "${LIB_NAME}")
endforeach()

find_library(
        log-lib
        log )

add_library(
        ffmpeg_v4_native-lib
        SHARED
        native-lib.cpp
)

target_link_libraries(
        ffmpeg_v4_native-lib
        #ffmpeg链接到native-lib
        ${FFMPEG_LIBRARIES}
        ${log-lib}
        android
)
